<section class="wrapper site-min-height" xmlns:th="http://www.w3.org/1999/xhtml">
    <h3><i class="fa fa-angle-right"></i> 查看作业</h3>
    <div class="row mt">
        <div class="col-lg-12">
            <div class="content-panel">
                <section id="no-more-tables">
                    <table class="table table-bordered table-striped table-condensed cf">
                        <thead class="cf">
                        <tr>
                            <th>作业编号</th>
                            <th>作业名称</th>
                            <th>选择题</th>
                            <th>设计题</th>
                            <th>发布时间</th>
                            <th>截止时间</th>
                            <th>已完成</th>
                            <th>已截止</th>
                            <th>上交作业</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:id="${homework.homeworkId}" th:each="homework:${views}">
                            <td th:text="${homework.homeworkId}"></td>
                            <td th:text="${homework.homeworkName}"></td>
                            <td ><a href="javascript:void(0);" target="_blank" th:onclick="'javascript:getChoices('+${homework.questionId}+')'">选择题</a></td>
                            <td ><a href="javascript:void(0);" target="_blank" th:onclick="'javascript:getDesigns('+${homework.questionId}+')'">设计题</a></td>
                            <td th:text="${homework.publishTime}"></td>
                            <td th:text="${homework.endTime}"></td>
                            <td>
                                <div th:if="${homework.finished}">是</div>
                                <div th:unless="${homework.finished}"><font color="red">否</font></div>
                            </td>
                            <td>
                                <div th:if="${homework.timeOut}">是</div>
                                <div th:unless="${homework.timeOut}">否</div>
                            </td>
                            <th>
                                <button class="btn btn-primary btn-xs" th:onclick="'javascript:updateHomeworkModel('+${homework.homeworkId}+')'" data-toggle="modal" data-target="#homeworkUpload"><i class="fa fa-upload"></i></button>
                                <button class="btn btn-primary btn-xs" th:if="${homework.finished}" th:onclick="'javascript:readDocumentByHomework('+${homework.homeworkId}+')'" data-toggle="modal" data-target="#docModel"><i class="fa fa-eye"></i></button>
                            </th>
                        </tr>
                        </tbody>
                    </table>
                </section>


                <!-- 模态框（Modal） -->
                <div class="modal fade" id="homeworkUpload" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                    &times;
                                </button>
                                <h4 class="modal-title" id="myModalLabel">
                                    上传作业文件
                                </h4>
                            </div>
                            <div class="modal-body">
                                <input type="file" id="homeworkFile"/>
                                <input type="hidden" id="fileHomeworkId"/>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                                </button>
                                <button class="btn btn-default" th:onclick="'javascript:submitHomework()'">上传作业</button>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal -->
                </div>

                <div class="modal fade" id="docModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                    &times;
                                </button>
                            </div>
                                <div id="docContent"></div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal -->
                </div>
            </div><!-- /content-panel -->
        </div><!-- /col-lg-12 -->
    </div><!-- /row -->
</section>